<template>
  <wl-list class="wl-content-container" :listData="myState" @pageChange="pageChange" @sizeChange="sizeChange">
    <wl-query slot="query"  :needAdv="false" @doQuery="doQuery">
      <template slot="main">
          <el-form :model="mainData" class="form-query"  label-width="80px" >
            <wl-form-item :importance="false"  label="域名网址" prop="url" :itemData="mainData">
              <wl-input slot="input" slot-scope="col" class="wl-input-item" :rawData="col.columnData" field="url" placeholder="请输入域名网址"></wl-input>
            </wl-form-item>
            <wl-form-item :importance="false" label="网站名称" prop="name"   :itemData="mainData">
                <wl-arr-select reqUrl="/website/visit/list.do" :isMore="false" slot="input" slot-scope="col" itemName="web_name" type="name"  :rawData="col.columnData"></wl-arr-select>
            </wl-form-item>
            <wl-form-item :importance="false"  label="添加人" prop="create_name" :itemData="mainData">
                <wl-arr-select reqUrl="/account/list.do" :isMore="false" slot="input" slot-scope="col" type="create_name"  :rawData="col.columnData"></wl-arr-select>
            </wl-form-item>
          </el-form>
      </template>
    </wl-query>
    <wl-container slot="operator" align="right">
      <wl-tip-button icon="btn_xz1" :isNew="true" setW="100" tipsDisabled @click="doNew" label="申请新增"></wl-tip-button>
      <wl-tip-button btnType="" :isNormal="true" setW="135" icon="btn_back"  tipsDisabled @click="doReturn" label="返回历史数据"></wl-tip-button>
    </wl-container>
    <el-table  class="visit-table" id="visit-table" slot="table" :row-class-name="rowClassName" :data="myState.data_list" style="width: 100%" border stripe @selection-change="handleSelectionChange">
      <el-table-column type="selection" width="40"></el-table-column>
      <el-table-column type="expand">
       <template slot-scope="props">
        <el-form label-position="left" inline class="demo-table-expand">
          <!-- <el-form-item  v-for="(item,key) in props.row" :key="key" :label="key">
            <span>{{ props.row[key] }}</span>
          </el-form-item> -->
          <el-form-item label="域名网址">
            <span>{{ props.row.url }}</span>
          </el-form-item>
          <el-form-item label="网站名称">
            <span>{{ props.row.web_name }}</span>
          </el-form-item>
            <el-form-item label="添加人">
            <span>{{ props.row.add_name }}</span>
          </el-form-item>
            <el-form-item label="网站状态">
            <span>{{ setVal(props.row.web_status) }}</span>
          </el-form-item>
            <el-form-item label="U盾持有者">
            <span>{{ props.row.u_names }}</span>
          </el-form-item>
        </el-form>
      </template>
      </el-table-column>
      <el-table-column label="操作" width="120" class-name="operation_cell">
        <template slot-scope="scope">
          <wl-tip-button  :id="'visit_btn' + scope.$index" v-if="scope.row.auth" icon="btn_fw" :data-loginType="scope.row.login_type"  :data-id="scope.row.id" tips="访问"  onclick="console.log('执行');javaExecute.running(this.getAttribute('data-loginType'),this.getAttribute('data-id'),null)" ></wl-tip-button>
          <wl-tip-button   icon="btn_sq2" v-else tips="申请" @click="rowEdit(scope.$index, scope.row)"></wl-tip-button>
        </template>
      </el-table-column>
      <el-table-column prop="web_status" label="网站状态">
        <template slot-scope="scope">
         <wl-status type="web_status" :label="scope.row.web_status"></wl-status>
        </template>
      </el-table-column>
      <el-table-column prop="url" label="域名网址"></el-table-column>
      <el-table-column prop="web_name" label="网站名称"></el-table-column>
      <el-table-column prop="add_name" label="添加人"></el-table-column>
    </el-table>
  </wl-list>
</template>

<script lang="ts" src="./web_visit.ts"></script>

